﻿@model IEnumerable<Cadcam7Moddel.Model.NgonNgu>
@{
    var curlang = (Cadcam7Moddel.Model.NgonNgu)ViewBag.curlang;
 }
<div class="nav-collapse">
				<ul id="menu" class="nav ">
                        <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="@Url.Action("Index","Home")">Home <span class="caret"></span></a></li>
                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="@Url.Action("Index","Cauhinhtrang")">Cấu hình <span class="caret"></span></a></li>
                        <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="@Url.Action("Index","Trang")">Trang <span class="caret"></span></a></li>
                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="@Url.Action("Index","Tintuc")">Tin Tức <span class="caret"></span></a></li>
                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="@Url.Action("Index","Slideshow")">Slideshow <span class="caret"></span></a></li>
                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="@Url.Action("Index","Loaitin")">Loại tin <span class="caret"></span></a></li>
				</ul>
				<ul class="pull-right nav" style="color:#fff">
                    <li><select style="margin-top:10px;" id="sslang">@foreach (var l in Model) {
                                                         if (Request.Cookies["_culture"]["lang"].ToString() == l.Ma)
                                                         {
                                                              <option selected="selected" value="@l.Ma">@l.TenNgonNgu</option>
                                                         }
                                                         else
                                                         { 
                                                                <option value="@l.Ma">@l.TenNgonNgu</option>
                                                         }
                                                    
                                                     }</select>
                        <img src="@Url.Content("~"+curlang.HinhAnh)" />
                    </li>
				</ul>
			</div>
<script>
    $(document).ready(function () {
        $("#sslang").change(function () {
            
            var lang = $(this).val();
            $.ajax({
                type: "post", url: "@Url.Action("AjaxLang","Language")", data: { lang: lang }, dataType: "json", success: function () {
                    window.location.reload();
                }
            });
            return false;
        });
    });
</script>